{extend name="public/base" /}
{block name="pjax_container"}
<?php
    $titleTypeName = '任务详情';
?>
<style>


    .content-header>.breadcrumb>li {
        color: #999;
    }

    .content-header>.breadcrumb>.active {
        color: #666;
    }

    .content-header {
        height: 51px;

    }

    .btn-primary {
        background-color: #1890FF;
        color: #fff;
        border: none;
        border-radius: 3px !important;
        margin-left: 15px;
        padding: 7px 13px;
    }

    .box-primary {
        border-top-color: #ecf0f5 !important;
        border-top-width: 16px;

    }

    .btn-primary:hover {
        background-color: #1890FF;
        color: #fff;
        border: none;
        opacity: .9;
        border-radius: 6px !important;
    }

    .delete-one {
        background-color: ff4141 !important;
        margin-left: 15px;
        border-radius: 6px;
    }

    .sreachs {
        background-color: #1890FF;
        color: #fff;
        border: none;
        border-radius: 6px !important;
        margin-left: 15px;
        padding: 7px 15px;
    }

    .nav-tabs-custom {
        margin-bottom: 20px;
        background: #fff;
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
        border-radius: 3px;
        margin-top: 16px;
    }

    tr>th,
    td {
        text-align: center;
    }

    label {
        margin-left: 10px;
    }

    .tab_1,
    .tab_3 {
        box-shadow: 0 0 5px #ccc;
        padding: 20px 0;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }


    .form-group>div {
        color: #666;
        margin-left: 10px;
        text-shadow: 0 0 5px transparent;
    }

    .form-group:hover {
        background-color: #eee;
    }

    .tab_3>.form-group>div>div {
        padding: 5px 0;
    }

    .tab_2 tr td {

        border: 1px solid #eee;
        font-size: 14px;

        padding: 20px 0 !important;
    }
</style>
<section class="content-header">
    <ol class="breadcrumb">
        <li>任务大厅</li>
        <li>我的任务</li>
        <li class="active">{$titleTypeName}</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <form class="form-horizontal" method="POST"
                action="/{$Think.MODULE_NAME}/{$Think.CONTROLLER_NAME}/{$Think.ACTION_NAME}" onsubmit="return false">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm"
                                style="padding:10px 2px;"><i class="fa fa-list"></i> 返回</a></li>
                    </ul>
                    <div class="tab-content">
                        <ul class="nav nav-tabs" style="margin-bottom: 40px;">
                            <li role="presentation" class="fq_nav fq_nav_1 active"><a href="#">任务</a></li>
                            <li role="presentation" class="fq_nav fq_nav_2"><a href="#">参与人</a></li>
                            <li role="presentation" class="fq_nav fq_nav_3"><a href="#">审批</a></li>
                            {if condition="$task.type eq 2"}
                            <li role="presentation" class="fq_nav fq_nav_4"><a href="#">报名</a></li>
                            {/if}
                        </ul>
                        <div class=" tab_1">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">任务名称:</label>
                                <div class="col-sm-5" style="padding-top: 7px;">
                                    {$task.name}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">任务内容:</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    {$task.content}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">任务类型:</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    {if condition="$task.type eq 1"}
                                    指定任务
                                    {else:}
                                    悬赏任务
                                    {/if}
                                </div>
                            </div>
                            {if condition="$task.type eq 2"}
                            <!-- <div class="check"> -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label">报名奖分:</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    {$task.apply_integral}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">报名截止时间:</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    {:date('Y-m-d H:i',$task.apply_end_time)}
                                </div>
                            </div>
                            <!-- </div> -->
                            {/if}
                            <div class="form-group">
                                <label class="col-sm-2 control-label">任务负责人:</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    {$task.e_name}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">截止时间:</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    {:date('Y-m-d H:i',$task.end_time)}
                                </div>
                            </div>
                        </div>
                        <div style="display: none;" class=" tab_2">
                            <table class="table table-striped table-hover" style="text-align: center;">
                                <tr>
                                    <th style="text-align: center;">姓名</th>
                                    <th style="text-align: center;">工号</th>
                                    <th style="text-align: center;">部门</th>
                                </tr>
                                {volist name="$user_take" id="v"}
                                <tr>
                                    <td>{$v.name}</td>
                                    <td>{$v.job_number}</td>
                                    <td>{$v.department_name}</td>
                                </tr>
                                {/volist}
                            </table>
                        </div>
                        <div style="display: none;" class=" tab_3">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">终审</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    <div>终审人: {$task.c_name}</div>
                                    终审意见: {$task.last_check_opinion}
                                    {if condition="$task.status gt 1 && $task.status neq 5"}
                                    <div>终审状态: 审核通过</div>
                                    终审意见: {$task.last_check_opinion}
                                    <div>终审时间: {:date('Y-m-d H:i',$task.last_check_time)}</div>
                                    {else:}
                                    <div>终审状态: 待审核</div>
                                    {/if}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">初审</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    <div>初审: {$task.b_name}</div>
                                    初审意见: {$task.first_check_opinion}
                                    {if condition="$task.status gt 0 && $task.status neq 5"}
                                    <div>初审状态: 审核通过</div>
                                    <div>初审时间: {:date('Y-m-d H:i',$task.first_check_time)}</div>
                                    {else:}
                                    <div>初审状态: 待审核</div>
                                    {/if}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">记录人</label>
                                <div class="col-sm-7" style="padding-top: 7px;">
                                    <div>{$task.d_name}</div>
                                    <div>记录人奖分：B {$integral}分</div>
                                    <div>{:date('Y-m-d H:i',$task.create_time)}</div>
                                </div>
                            </div>
                        </div>
                        <div style="display: none;" class=" tab_4">
                            <table class="table table-striped" style="text-align: center;">
                                <tr>
                                    <th style="text-align: center;">姓名</th>
                                    <th style="text-align: center;">工号</th>
                                    <th style="text-align: center;">部门</th>
                                </tr>
                                {volist name="$apply" id="v"}
                                <tr>
                                    <td style="display: flex;align-items: center;justify-content: center;"><img
                                            style="width: 30px;height: 30px;border-radius: 50%;" src="{$v.avatar}"
                                            alt="">
                                        <div style="margin-left: 10px;">{$v.name}</div>
                                        <div style="margin-left: 20px;">理由：{$v.reason}</div>
                                    </td>
                                    <td>{$v.job_number}</td>
                                    <td>{$v.department_name}</td>
                                </tr>
                                {/volist}
                            </table>
                        </div>
                    </div>


                </div>
            </form>
        </div>
    </div>
</section>
<script type="application/javascript">
    $(document).ready(function () {
        /*ajax页面加载icheck，有该控件的页面才需要*/
        $(".select2").select2({ language: "zh-CN" });

    })
    $('.minimal').on('click', function () {
        var type = $(this).val();
        if (type == 2) {
            $('.check').show();
        } else if (type == 1) {
            $('.check').hide();
        }

    });
</script>
<script>
    $('.fq_nav').click(function () {
        $('.fq_nav').removeClass('active');
        $(this).addClass('active')
    })
    $('.fq_nav_1').click(function () {
        $('.tab_1').show();
        $('.tab_2').hide();
        $('.tab_3').hide();
        $('.tab_4').hide();
    })
    $('.fq_nav_2').click(function () {
        $('.tab_1').hide();
        $('.tab_2').show();
        $('.tab_3').hide();
        $('.tab_4').hide();
    })
    $('.fq_nav_3').click(function () {
        $('.tab_1').hide();
        $('.tab_2').hide();
        $('.tab_3').show();
        $('.tab_4').hide();
    })
    $('.fq_nav_4').click(function () {
        $('.tab_1').hide();
        $('.tab_2').hide();
        $('.tab_3').hide();
        $('.tab_4').show();
    })
</script>
{/block}